package com.itlong.cloud.enumerate;

/**
 * <desc>
 *      单梯多梯权限枚举
 * </desc>
 *
 * @Author Zhu.yj
 * @createDate  2020/9/7
 */
public enum MultiElevatorAuthEnum {

    NONE_ELEVATOR_AUTH("无权限", "0"),
    SINGLE_ELEVATOR_AUTH("单梯权限","2"),
    MULTI_ELEVATOR_AUTH("多梯权限", "1"),
    ENTRANCE_AUTH("门禁权限", "3");

    private String description;     //描述
    private String type;            //类型

    MultiElevatorAuthEnum(String description, String type){
        this.description = description;
        this.type = type;
    }

    /**
     * <desc>
     *      获取类型
     * </desc>
     *
     * @Author Zhu.yj
     * @createDate  2020/9/7
     */
    public String getType(){
        return this.type;
    }

    public String getDescription(){
        return this.description;
    }

    /**
     * <desc>
     *      通过类型获取枚举对象
     * </desc>
     *
     * @param type
     * @return
     * @Author Zhu.yj
     * @createDate  2021/4/12
     */
    public static MultiElevatorAuthEnum getByType(String type){
        for (MultiElevatorAuthEnum authEnum : values()){
            if (authEnum.getType().equals(type)){
                return authEnum;
            }
        }
        return NONE_ELEVATOR_AUTH;
    }
}
